Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated class name to match Cloudflare's #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

franciscop
Copy link

@franciscop franciscop commented Jul 21, 2024

I've got an implementation that tests whether a given "client" is a Cloudflare KV. I use this code:

return client?.constructor?.name === "KvNamespace";

The issue with the code testing is that Cloudflare uses the KvNamespace class name, and edge-mock uses EdgeKVNamespace for the class name. With this PR, I'm hoping that edge-mock also uses the same name as Cloudflare to match better the mock.

In the Cloudflare Worker Editor, how this code:

image

Yields this result:

image

@franciscop franciscop changed the title Updated class name Updated class name to match Cloudflare's Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant